package com.jh.paymentchannel.service;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.jh.paymentchannel.business.TopupPayChannelBusiness;
import com.jh.paymentchannel.util.Util;

@Controller
@EnableAutoConfiguration
public class JFCoinInfoPage {
	 
	private static final Logger LOG = LoggerFactory.getLogger(JFCoinInfoPage.class);
	
	@Autowired
	private TopupPayChannelBusiness topupPayChannelBusiness;
	
	@Autowired
	private Util util;
	
	
	@RequestMapping(method=RequestMethod.GET,value="/v1.0/paymentchannel/topup/tojfcoinbankinfo")
	public  String tojfcoinbankinfo(HttpServletRequest request, HttpServletResponse response, Model model)throws IOException {
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
		LOG.info("/v1.0/paymentchannel/topup/tojfcoinbankinfo=========tojfcoinbankinfo");
		String bankName = request.getParameter("bankName");//结算卡银行名称
		String bankNo = request.getParameter("bankNo");//结算卡卡号
		String amount = request.getParameter("amount");
		String ordercode = request.getParameter("ordercode");
		String provinceOfBank = request.getParameter("provinceOfBank");
		String cityOfBank = request.getParameter("cityOfBank");
		String bankBranchName = request.getParameter("bankBranchName");
		String bankBranchId = request.getParameter("bankBranchId");
		String cardType = request.getParameter("cardType");
		String isRegister = request.getParameter("isRegister");
		String cardtype = request.getParameter("cardtype");
		String bankCard = request.getParameter("bankCard");//充值卡卡号
		String cardName = request.getParameter("cardName");//充值卡银行名称
		String expiredTime = request.getParameter("expiredTime");//充值卡有效期
		String securityCode = request.getParameter("securityCode");//充值卡安全码
		
		
		
		model.addAttribute("bankName", bankName);
		model.addAttribute("bankNo",bankNo);
		model.addAttribute("amount", amount);
		model.addAttribute("ordercode", ordercode);
		model.addAttribute("provinceOfBank", provinceOfBank);
		model.addAttribute("cityOfBank", cityOfBank);
		model.addAttribute("bankBranchName", bankBranchName);
		model.addAttribute("bankBranchId", bankBranchId);
		model.addAttribute("cardType", cardType);
		model.addAttribute("isRegister", isRegister);
		model.addAttribute("cardtype", cardtype);
		model.addAttribute("bankCard", bankCard);
		model.addAttribute("cardName", cardName);
		model.addAttribute("expiredTime", expiredTime);
		model.addAttribute("securityCode", securityCode);
		
		return "jfcoinbankInfo";
	}
	
	
	@RequestMapping(method=RequestMethod.GET,value="/v1.0/paymentchannel/topup/tojfcoincreditcard")
	public  String tojfcoincreditcart(HttpServletRequest request, HttpServletResponse response, Model model)throws IOException {
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
		LOG.info("/v1.0/paymentchannel/topup/tojfcoincreditcard===========tojfcoincreditcard");
		String cardName = request.getParameter("cardName");
		String bankCard = request.getParameter("bankCard");
		String amount = request.getParameter("amount");
		String ordercode = request.getParameter("ordercode");
		String provinceOfBank = request.getParameter("provinceOfBank");
		String cityOfBank = request.getParameter("cityOfBank");
		String bankBranchName = request.getParameter("bankBranchName");
		String bankBranchId = request.getParameter("bankBranchId");
		String cardType = request.getParameter("cardType");
		String isRegister = request.getParameter("isRegister");
		String expiredTime = request.getParameter("expiredTime");//充值卡有效期
		String securityCode = request.getParameter("securityCode");//充值卡安全码
		
		model.addAttribute("cardName", cardName);
		model.addAttribute("bankCard",bankCard);
		model.addAttribute("amount", amount);
		model.addAttribute("ordercode", ordercode);
		model.addAttribute("provinceOfBank", provinceOfBank);
		model.addAttribute("cityOfBank", cityOfBank);
		model.addAttribute("bankBranchName", bankBranchName);
		model.addAttribute("bankBranchId", bankBranchId);
		model.addAttribute("cardType", cardType);
		model.addAttribute("isRegister", isRegister);
		model.addAttribute("expiredTime", expiredTime);
		model.addAttribute("securityCode", securityCode);
		
		return "jfcoincreditcard";
	}
	
	
	
	@RequestMapping(method=RequestMethod.GET,value="/v1.0/paymentchannel/topup/jfcoinpaysuccess")
	public  String returncoinpaysuccess(HttpServletRequest request, HttpServletResponse response, Model model)throws IOException {
		// 设置编码
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
		
		LOG.info("/v1.0/paymentchannel/topup/jfcoinpaysuccess==========jfcoinpaysuccess");
		
		return "sdjsuccess";
	}
	
	
	@RequestMapping(method=RequestMethod.GET,value="/v1.0/paymentchannel/topup/jfcoinpayerror")
	public  String returncoinpayerror(HttpServletRequest request, HttpServletResponse response, Model model)throws IOException {
		// 设置编码
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
	
		LOG.info("/v1.0/paymentchannel/topup/jfcoinpayerror==========jfcoinpayerror");
		
		return "sdjerror";
	}
	
	

	
}
	
